//14.2 - globals.cpp - Mark Lee - Prima Publishing #include "globals.h" int DoEventLoop() //this funtion is the event loop from WinMain { MSG msg; //event loop - handle all messages while(GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } //standard return value return (msg.wParam); } void InitApp(HINSTANCE hInst,int nCmdShow) //creates the window { HWND hWnd; WNDCLASSEX wc; //fill the WNDCLASSEX structure with //the appropriate values wc.cbSize = sizeof(WNDCLASSEX); wc.style = NULL; wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInst; wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hCursor = NULL; wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); wc.lpszMenuName = NULL; wc.lpszClassName = "PiratesAdventure"; wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION); //register the new class RegisterClassEx(&wc); //create a window hWnd = CreateWindowEx( NULL, "PiratesAdventure", "Pirates Adventure", WS_POPUP, 0, 0, 800, 600, NULL, NULL, hInst, NULL ); //load the maps LoadMaps(); }